class CreateForums < ActiveRecord::Migration
  def self.up
    create_table :forums do |t|
      t.string :title, :limit => 100, :null => false
      t.text :description, :null => false
      t.references :course, :null => false

      t.timestamps
    end

    add_index(:forums, [:course_id, :title], :unique => true, :name => "uk_title_forums")
  end

  def self.down
    drop_table :forums
  end
end
